package myprogram;

import java.awt.Color;

import com.supermap.data.GeoStyle;
import com.supermap.data.Size2D;
import com.supermap.mapping.Layer;
import com.supermap.mapping.ThemeDotDensity;

import ui.UI;

public class DotDensity implements UI{
	Layer ly;
	
	public void createDotDensityMap(String field, double pointValue, int maxPoint) {
		try {
			ThemeDotDensity dotdensity = new ThemeDotDensity();
			dotdensity.setDotExpression(field);
			dotdensity.setValue(pointValue);
			
			GeoStyle geostyle = new GeoStyle();
			geostyle.setLineColor(Color.CYAN);
			geostyle.setMarkerSize(new Size2D(5,5));
			
			dotdensity.setStyle(geostyle);
			
			ly = mapcontrol1.getMap().getLayers().add(mapcontrol1.getMap().getLayers().get(0).getDataset(),
					dotdensity, true);
			ltree.reload();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		ly.setVisible(true);
		mapcontrol1.getMap().refresh();
	}
}
